package com.woniuxy.light_smart.service.imp;

import com.woniuxy.light_smart.mapper.UserRoleMapper;
import com.woniuxy.light_smart.service.UserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class UserRoleServiceImpl implements UserRoleService {
    @Resource
    private UserRoleMapper userRoleMapper;


    @Override
    @Transactional
    public void addRole(Long uid, Object[] rids) {
        userRoleMapper.deleteRidByUid(uid);
        userRoleMapper.saveRoleByUser(uid,rids);

    }
}
